﻿//-----------------------------------------------------------------------
// <copyright file="FileSourceProcessorBase.cs" company="Anurag Chatterjee">
//     Copyright (c) Anurag Chatterjee. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
namespace WordsBase
{
    using System;
    using System.Collections.Generic;

    /// <summary>
    /// The word processor base class
    /// </summary>
    public abstract class FileSourceProcessorBase
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="FileSourceProcessorBase"/> class.
        /// </summary>
        protected FileSourceProcessorBase()
        {
            this.AddWordToRootInSource = null;
            this.DeleteWordFromRootInSource = null;
            this.UpdateWordInRootInSource = null;
            this.PopulateFromSource = null;
        }

        /// <summary>
        /// Gets or sets the last error message.
        /// </summary>
        /// <value>
        /// The last error message.
        /// </value>
        protected string LastErrorMessage { get; set; }

        /// <summary>
        /// Gets or sets the add word to root in source.
        /// </summary>
        /// <value>
        /// The add word to root in source.
        /// </value>
        protected Func<string, string, bool> AddWordToRootInSource
        {
            get; set;
        }

        /// <summary>
        /// Gets or sets the delete word from root in source.
        /// </summary>
        /// <value>
        /// The delete word from root in source.
        /// </value>
        protected Func<string, string, bool> DeleteWordFromRootInSource
        {
            get; set;
        }

        /// <summary>
        /// Gets or sets the update word in root in source.
        /// </summary>
        /// <value>
        /// The update word in root in source.
        /// </value>
        protected Func<string, string, string, bool> UpdateWordInRootInSource
        {
            get; set;
        }

        /// <summary>
        /// Gets or sets the populate from source.
        /// </summary>
        /// <value>
        /// The populate from source.
        /// </value>
        protected Func<string, Dictionary<string, string>> PopulateFromSource
        {
            get; set;             
        } 
    }
}
